import controllogic.*;
import controllogic.syntaxtree.*;
import controllogic.visitor.*;

public class MainTest
{
	public static void main(String[] args)
	{
		FOLParser parser = new FOLParser(System.in);
		try {
			Node root = parser.one_line();
			String prefix = (String) (root.accept(new GJNoArguDepthFirst<String>())) ;
			System.out.println("Prefix: " + prefix);
		} catch (ParseException e) {
			System.out.println(e.toString());
		}
	}

}